---
title: Search and open a legal case
summary: Locate and load a claim-linked legal case with claim context and security applied.
status: draft
owner: <owner>
last_reviewed: 2026-08-21
operation_id: OP-APP-001
trigger: User submits a case search on frmCaseSearch
---

# Search and open a legal case

This workflow searches for a legal case, establishes claim context, applies confidential-claim security, and loads the legal case aggregate for downstream screens.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-APP-001 |
| **Trigger** | User submits a search on [frmCaseSearch](../../screens/frm-case-search.md) |
| **Libraries involved** | [SAIF.Application.Claim.Legal](../../libraries/saif-application-claim-legal/overview.md), [SAIF.Application.Claim](../../libraries/saif-application-claim/overview.md), [SAIF.Business.Claim.Legal](../../libraries/saif-business-claim-legal/overview.md), [SAIF.Business.View.Policy](../../libraries/saif-business-view-policy/overview.md) |
| **Screens** | [frmCaseSearch](../../screens/frm-case-search.md) |
| **Inputs** | Search mode and search criteria (claim number, case number, WCB number, or party name) |
| **Outputs** | Loaded `clsLegalCase` / `clsLegalData` for the selected case; established claim and policy context for downstream screens |

## Steps

1. `clsCaseSearchManager` renders [frmCaseSearch](../../screens/frm-case-search.md), validates the selected search mode, and requests search results — owned by [SAIF.Application.Claim.Legal](../../libraries/saif-application-claim-legal/overview.md).
2. [SAIF.Business.Claim.Legal](../../libraries/saif-business-claim-legal/overview.md) executes the case-search retrieval path through `clsCaseSearchCriteria`, `clsCaseSearchResult`, or `clsFindCase` and returns matching cases.
3. `ClaimAppManager` establishes claim context — owned by [SAIF.Application.Claim](../../libraries/saif-application-claim/overview.md):
   - Loads `ClaimData` and applies claim-level security ([BR-APP-001](../business-rules.md#br-app-001-confidential-claim-access-gating)).
   - On a confidential claim (`IsWorkerConflict` or `IsExposure`) without the required `LNConflict`/`LNExposure` resource or override, access is denied and the search result is not opened.
4. `LegalManagerBase` sets the current legal case, loads `clsLegalCase`, and loads the legal header data object `clsLegalData` — owned by [SAIF.Application.Claim.Legal](../../libraries/saif-application-claim-legal/overview.md) (`LegalManagerBase.SetCurrentCase`).
   - `OnCheckSecurity()`/`OnRetrieve()` applies the default-restricted-access rule ([BR-APP-002](../business-rules.md#br-app-002-default-restricted-access-with-explicit-role-escalation)): the screen defaults to view-only or no-access until the role check explicitly grants an update role.
5. [SAIF.Business.View.Policy](../../libraries/saif-business-view-policy/overview.md) supplies policy and agency context for downstream summary, request, and case-cost screens once the case is opened.

## Process flow

The following diagram visualizes this workflow across components.

```mermaid
flowchart TD
	Start([User submits case search]) --> S1[clsCaseSearchManager validates search mode]
	S1 --> S2[SAIF.Business.Claim.Legal executes case-search retrieval]
	S2 --> D{Claim confidential flags set?}
	D -->|Yes, no resource/override| EndErr([Access denied - confidential claim])
	D -->|No, or resource granted| S3[ClaimAppManager establishes claim context]
	S3 --> S4[LegalManagerBase loads clsLegalCase and clsLegalData]
	S4 --> S5[SAIF.Business.View.Policy supplies policy context]
	S5 --> EndOk([Case opened for downstream screens])
```

## Failure and edge-case behavior

- Confidential claim access denial: if the underlying claim is flagged `IsWorkerConflict` or `IsExposure` and the user lacks the applicable AD resource and any security override fails, the case does not open and a confidential-access error message is displayed ([BR-APP-001](../business-rules.md#br-app-001-confidential-claim-access-gating)).
- No matching search results: `clsCaseSearchResult` returns an empty result set and the screen remains on the search form.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [Data model](../data-model.md)

## Sources
- `SAIF.Application.Claim.Legal/LegalNet/clsCaseSearchManager.vb`
- `SAIF.Application.Claim.Legal/LegalManagerBase.vb`
- `SAIF.Application.Claim/ClaimAppManager.vb`
